In [3]:
#import libraries
import pandas as pd
import pandas_profiling
In [4]:
%cd "C:\SGS\VA\HW3"
C:\SGS\VA\HW3
In [8]:
df = pd.read_csv("Homicidios_2018.csv")
print(df.shape)
df.head(2)
(11353, 20)
Out[8]:
Fecha Departamento Municipio Día Hora Barrio Zona Clase de sitio Arma empleada Móvil Agresor Móvil Victima Edad Sexo Estado civil País de nacimiento Clase de empleado Profesión Escolaridad Código DANE Cantidad
0 01/01/2018 AMAZONAS LETICIA (CT) Lunes 9:45:00 ESPERANZA URBANA VIAS PUBLICAS ARMA BLANCA / CORTOPUNZANTE A PIE A PIE 16.0 MASCULINO SOLTERO BRASIL EMPLEADO PARTICULAR - SECUNDARIA 91001000.0 1
1 01/01/2018 AMAZONAS LETICIA (CT) Lunes 9:45:00 ESPERANZA URBANA VIAS PUBLICAS ARMA BLANCA / CORTOPUNZANTE A PIE A PIE 17.0 MASCULINO SOLTERO BRASIL EMPLEADO PARTICULAR - SECUNDARIA 91001000.0 1
In [9]:
df.profile_report()
c:\users\gonlina2\appdata\local\continuum\anaconda3\envs\nice\lib\site-packages\pandas_profiling\model\correlations.py:124: UserWarning: There was an attempt to calculate the cramers correlation, but this failed.
To hide this warning, disable the calculation
(using `df.profile_report(correlations={"cramers": False}`)
If this is problematic for your use case, please report this as an issue:
https://github.com/pandas-profiling/pandas-profiling/issues
(include the error message: 'The internally computed table of expected frequencies has a zero element at (0, 3).')
  correlation_name=correlation_name, error=error
Out[9]:

In [11]:
dfm= df[df.Sexo == "FEMENINO"]
print(dfm.shape)
dfm.head(2)
(971, 20)
Out[11]:
Fecha Departamento Municipio Día Hora Barrio Zona Clase_de_sitio Arma_empleada Móvil_Agresor Móvil_Victima Edad Sexo Estado_civil País_de_nacimiento Clase_de_empleado Profesión Escolaridad Código_DANE Cantidad
6 01/01/2018 ANTIOQUIA ANORÍ Lunes 5:35:00 PARQUE PRINCIPAL URBANA BARES, CANTINAS Y SIMILARES ARMA BLANCA / CORTOPUNZANTE A PIE A PIE 25.0 FEMENINO SOLTERO COLOMBIA INDEPENDIENTE - SECUNDARIA 5040000.0 1
8 01/01/2018 ANTIOQUIA HISPANIA Lunes 18:30:00 LA CANCHA URBANA ESTABLECIMIENTO PUBLICO ARMA DE FUEGO A PIE A PIE 32.0 FEMENINO UNION LIBRE COLOMBIA EMPLEADO PARTICULAR TECNOLOGO EN INGENIERIA DE SISTEMAS TECNOLOGO 5353000.0 1
In [13]:
dfm.profile_report()
Out[13]:

In [ ]: